<?php

namespace Admin;

use Admin\Model\UserTable;
use Admin\Model\TintucTable;
use Admin\Model\SliderTable;
use Admin\Model\HocsinhTable;
use Admin\Model\LopTable;
use Admin\Model\GiaovienTable;
use Admin\Model\MonhocTable;
use Admin\Model\ThoikhoabieuTable;
use Admin\Model\LichdayTable;
use Admin\Model\BangdiemTable;
use Admin\Model\LienketTable;
use Admin\Model\CounterTable;
use Admin\Model\MenuTable;
use Admin\Model\PhotoTable;
use Admin\Model\GalleryTable;
use Admin\Model\ThongtinTable;


class Module
{
    public function getAutoloaderConfig()
    {
        return array(
            'Zend\Loader\ClassMapAutoloader' => array(
                __DIR__ . '/autoload_classmap.php',
            ),
            'Zend\Loader\StandardAutoloader' => array(
                'namespaces' => array(
                    __NAMESPACE__ => __DIR__ . '/src/' . __NAMESPACE__,
                ),
            ),
        );
    }
    
    public function getServiceConfig()
    {
        return array(
            'factories' => array(
                'Admin\Model\UserTable' =>  function($sm) {
                    $dbAdapter = $sm->get('Zend\Db\Adapter\Adapter');
                    $table = new UserTable($dbAdapter);
                    return $table;
                },
				'Admin\Model\TintucTable' =>  function($sm) {
                    $dbAdapter = $sm->get('Zend\Db\Adapter\Adapter');
                    $table = new TintucTable($dbAdapter);
                    return $table;
                },
				'Admin\Model\SliderTable' =>  function($sm) {
                    $dbAdapter = $sm->get('Zend\Db\Adapter\Adapter');
                    $table = new SliderTable($dbAdapter);
                    return $table;
                },
				'Admin\Model\HocsinhTable' =>  function($sm) {
                    $dbAdapter = $sm->get('Zend\Db\Adapter\Adapter');
                    $table = new HocsinhTable($dbAdapter);
                    return $table;
                },
				'Admin\Model\LopTable' =>  function($sm) {
                    $dbAdapter = $sm->get('Zend\Db\Adapter\Adapter');
                    $table = new LopTable($dbAdapter);
                    return $table;
                },
				'Admin\Model\GiaovienTable' =>  function($sm) {
                    $dbAdapter = $sm->get('Zend\Db\Adapter\Adapter');
                    $table = new GiaovienTable($dbAdapter);
                    return $table;
                },
				'Admin\Model\MonhocTable' =>  function($sm) {
                    $dbAdapter = $sm->get('Zend\Db\Adapter\Adapter');
                    $table = new MonhocTable($dbAdapter);
                    return $table;
                },
				'Admin\Model\ThoikhoabieuTable' =>  function($sm) {
                    $dbAdapter = $sm->get('Zend\Db\Adapter\Adapter');
                    $table = new ThoikhoabieuTable($dbAdapter);
                    return $table;
                },
				'Admin\Model\LichdayTable' =>  function($sm) {
                    $dbAdapter = $sm->get('Zend\Db\Adapter\Adapter');
                    $table = new LichdayTable($dbAdapter);
                    return $table;
                },
				'Admin\Model\BangdiemTable' =>  function($sm) {
                    $dbAdapter = $sm->get('Zend\Db\Adapter\Adapter');
                    $table = new BangdiemTable($dbAdapter);
                    return $table;
                },
				'Admin\Model\LienketTable' =>  function($sm) {
                    $dbAdapter = $sm->get('Zend\Db\Adapter\Adapter');
                    $table = new LienketTable($dbAdapter);
                    return $table;
                },
				'Admin\Model\CounterTable' =>  function($sm) {
                    $dbAdapter = $sm->get('Zend\Db\Adapter\Adapter');
                    $table = new CounterTable($dbAdapter);
                    return $table;
                },
				'Admin\Model\MenuTable' =>  function($sm) {
                    $dbAdapter = $sm->get('Zend\Db\Adapter\Adapter');
                    $table = new MenuTable($dbAdapter);
                    return $table;
                },
				'Admin\Model\PhotoTable' =>  function($sm) {
                    $dbAdapter = $sm->get('Zend\Db\Adapter\Adapter');
                    $table = new PhotoTable($dbAdapter);
                    return $table;
                },
				'Admin\Model\GalleryTable' =>  function($sm) {
                    $dbAdapter = $sm->get('Zend\Db\Adapter\Adapter');
                    $table = new GalleryTable($dbAdapter);
                    return $table;
                },
				'Admin\Model\ThongtinTable' =>  function($sm) {
                    $dbAdapter = $sm->get('Zend\Db\Adapter\Adapter');
                    $table = new ThongtinTable($dbAdapter);
                    return $table;
                },
            ),
        );
    }  
	
	public function getViewHelperConfig()
	{
		return array(
			'invokables' => array(
				'formelementerrors' => 'Admin\Form\View\Helper\FormElementErrors'
			),
		);
	}  

    public function getConfig()
    {
        return include __DIR__ . '/config/module.config.php';
    }
	
	
}